package top.ffhome.concurrent.beautiful.ch01;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;

public class SleepTest {
    private static final Log log = LogFactory.get();

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(() -> {
            try {
                log.info("child thread is in sleep");
                Thread.sleep(10000);
                log.info("child thread is in awaked");
            } catch (InterruptedException e) {
                log.error("child thread exception:", e);
            }
        });

        thread.start();
        Thread.sleep(2000);
        thread.interrupt();
    }
}
